#include <iostream>
using namespace std;

const int kMaxN = 100 + 2;
const int kMaxS = 10000 + 2;

bool visited[kMaxN][kMaxS] = {false};
bool succeed[kMaxN][kMaxS] = {false};
int a[kMaxN], b[kMaxN];

void DFS(int dep, int sum, int n, int s) {
  visited[dep][sum] = true;
  if (dep == n) {
    if (sum == s) {
      succeed[n][s] = true;
    }
    return;
  }
  if (sum > s - (n - dep) || succeed[n][s]) {
    return;
  }
  if (sum + a[dep] <= s && !visited[dep + 1][sum + a[dep]]) {
    DFS(dep + 1, sum + a[dep], n, s);
    if (succeed[dep + 1][sum + a[dep]]) {
      succeed[dep][sum] = true;
      return;
    }
  }
  if (sum + b[dep] <= s && !visited[dep + 1][sum + b[dep]]) {
    DFS(dep + 1, sum + b[dep], n, s);
    if (succeed[dep + 1][sum + b[dep]]) {
      succeed[dep][sum] = true;
      return;
    }
  }
}

void GetPath(int dep, int sum, int n) {
  if (dep == n) {
    return;
  }

  if (succeed[dep + 1][sum + a[dep]]) {
    cout << "H";
    GetPath(dep + 1, sum + a[dep], n);
  } else {
    cout << "T";
    GetPath(dep + 1, sum + b[dep], n);
  }
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

  int n, s;

  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  DFS(0, 0, n, s);
  if (succeed[0][0]) {
    cout << "Yes" << endl;
    GetPath(0, 0, n);
    cout << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}